package me.yiyou.meihua.net

import me.yiyou.meihua.utils.LogUtil
import okhttp3.Interceptor
import okhttp3.Response

class LoggingInterceptor : Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {
        var request = chain.request()
        LogUtil.d("Interceptor request url : " + request.url())
        LogUtil.d("Interceptor request headers : " + request.headers())
        LogUtil.d("Interceptor request method : " + request.body().toString())
        val response: Response = chain.proceed(request)

        LogUtil.d("Interceptor response message : " + response)
        return response
    }
}